package com.cnfangmao.masterdata.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cnfangmao.masterdata.common.response.ResBody;
import com.cnfangmao.masterdata.service.UserService;

@RestController
@RequestMapping(path = "home")
public class HomeController {

    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);

    @GetMapping(path = "hello")
    public ResBody hello(@RequestParam("name") String name) {
        logger.info("hello 啊啊" + name);
        String realName = this.userService.getUserName(name);
        return ResBody.success("hello:  " + realName);
    }

    @Autowired private UserService userService;
}
